# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=amtk
pkgver=5.6.1
pkgrel=1
pkgdesc="Actions, Menus and Toolbars Kit for GTK applications"
url="https://gitlab.gnome.org/World/amtk"
arch=(loong64 x86_64)
license=(LGPL3)
depends=(gtk3)
makedepends=(meson git gobject-introspection gtk-doc)
options=(debug)
_commit=f0029cf75ec416159079a27b578b9253a04b1c5a
source=("git+https://gitlab.gnome.org/World/amtk.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd amtk
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd amtk
}

build() {
  arch-meson amtk build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(libg{lib,object,io}-2.0.so libgtk-3.so)
  provides+=("libamtk-${pkgver%%.*}.so")

  meson install -C build --destdir "$pkgdir"
}
